#include<stdio.h>
#include<math.h>

int n[1001];
int ip2(int x)
{
	int back=1;
	int i,sign,num=0;
	for(sign=2;sign<=x;sign++)
	{
		back=1;
		if(sign==1||(sign%2==0&&sign!=2)) back=0;
		for(i=3;i<=sqrt((double)sign);i+=2){
			if(sign%i==0){
				back=0;
				break;
			}
		}
		if(back==1)
		{
			n[num]=sign;
			num++;
		}
	}
	return num;
} 
int main()
{
	int x,key;
	scanf("%d",&x);
	int num=ip2(x);
	printf("%d\n",num);
	for(key=0;key<num;key++)
	{
		printf("%d",n[key]);
		if(key!=num-1) printf(" ");
	}
	return 0;
}
